<?php
/**
 * Created by PhpStorm.
 * User: 王松
 * Time: 2017/11/23 14:31
 */

namespace App\Project\Search\Decorator;

use App\Project\Search\Decorator;

class PhysicalDecorator extends Decorator
{
    protected $table = 'st_medical_physiquecheck';

    protected $prefix = 'physical';

    public function getBuilder()
    {
        return $this->fillBuilder([
            $this->table,
            'st_medical_records.id',
            $this->table . '.record_id'
        ]);
    }

    public function getAccessField()
    {
        return [
            'ebpl' => 'examination.blood_pressure.low',  //  舒张压
            'ebph' => 'examination.blood_pressure.high', //  收缩压
            'et'   => 'examination.thyroid',             //  甲状腺大
            'ee'   => 'examination.edema',               //  双下肢水肿
            'esr'  => 'examination.skin_rupture',        //  皮肤破溃
            'ellp' => 'examination.large_limb_profile',  //  肢大貌
            'os'   => 'other.sfp',                       //  锁骨上脂肪垫
            'obh'  => 'other.buffalo_hump',              //  水牛背
            'oan'  => 'other.acanthosis_nigricans',      //  颈部黑棘皮症
            'oe'   => 'other.ecchymosis',                //  瘀斑
            'oa'   => 'other.apl',                       //  腹部紫纹
            'oar'  => 'other.ankle_reflex',              //  踝反射
            'ob'   => 'other.btnp',                      //  大脚趾针刺
            'obs'  => 'other.bttfvs',                    //  大脚趾音叉振动
            'o10g' => 'other.10gnt',                     //  大脚趾10g尼龙丝触觉
        ];
    }

    public function getAccessOperator()
    {
        return [
            'ebpl' => 'all',
            'ebph' => 'all',
            'et'   => ['eq'],
            'ee'   => ['eq'],
            'esr'  => ['eq'],
            'ellp' => ['eq'],
            'os'   => ['eq'],
            'obh'  => ['eq'],
            'oan'  => ['eq'],
            'oe'   => ['eq'],
            'oa'   => ['eq'],
            'oar'  => ['eq'],
            'ob'   => ['eq'],
            'obs'  => ['eq'],
            'o10g' => ['eq'],
        ];
    }
}